package com.hsjk.szwj.module.train.controller.app;

import com.hsjk.szwj.framework.common.pojo.CommonResult;
import com.hsjk.szwj.framework.security.core.annotations.PreAuthenticated;
import com.hsjk.szwj.module.train.controller.app.vo.question.AppQuestionSetDetailRespVO;
import com.hsjk.szwj.module.train.service.IQuestionSetService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

import static com.hsjk.szwj.framework.common.pojo.CommonResult.success;

/**
 * @author chenjiawei
 * @desc
 * @Date 2023/11/04 21:54
 **/
@Tag(name = "应用端 - 题集相关接口")
@RestController
@RequestMapping("/train/question-set")
@Validated
public class AppQuestionSetController {
    @Resource
    private IQuestionSetService questionSetService;

    @GetMapping("/detail-by-id")
    @Operation(summary = "根据题集ID获取题集详情")
    @PreAuthenticated
    public CommonResult<AppQuestionSetDetailRespVO> getQuestionSetDetailById(@RequestParam("id") Long id) {
        return success(questionSetService.getQuestionSetDetailById(id));
    }
}
